package com.example.settlement.mapper;

import com.example.settlement.entity.Settlement;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import java.util.List;

@Mapper
public interface SettlementMapper {
    @Insert("INSERT INTO settlement (user_id, amount, create_time) VALUES (#{userId}, #{amount}, #{createTime})")
    void insert(Settlement settlement);

    @Select("SELECT * FROM settlement WHERE user_id = #{userId}")
    List<Settlement> findByUserId(Long userId);
}
